package com.meilai.project.controller.app;

import com.meilai.project.dto.CommonResult;
import com.meilai.project.dto.middleware.YunPianBehaviorVerificationDTO;
import com.meilai.project.service.middleware.YunPianService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 张驰
 * @date 2020/12/3 11:37
 */
@Api(value = "行为验证控制器", description = "行为验证相关")
@RestController
@RequestMapping("api/app/behavior_verification")
public class BehaviorVerificationController {

    @Autowired
    private YunPianService service;

    @GetMapping("get_appid")
    @ApiOperation(value = "获取APPID")
    public CommonResult getAPPID() {
        return new CommonResult().success(service.getBehaviorVerificationAPPID());
    }

    @PostMapping("behavior_verification")
    @ApiOperation(value = "验证行为")
    public CommonResult behaviorVerification(@RequestBody YunPianBehaviorVerificationDTO dto) {
        return new CommonResult().success(service.behaviorVerification(dto));
    }
}
